/*
 * Copyright (C) 2017-2021
 * All rights reserved, Designed By
 * Copyright authorization contact 18814114118
 */
package com.shop.cereshop.app.dao.collect;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.app.page.buyer.LikeAndCollectInfo;
import com.shop.cereshop.app.page.collect.CollectProduct;
import com.shop.cereshop.app.page.collect.CollectShop;
import com.shop.cereshop.app.page.collect.RecommendCollectVO;
import com.shop.cereshop.app.page.recommend.RecommendPageVO;
import com.shop.cereshop.commons.domain.collect.CereBuyerCollect;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CereBuyerCollectDAO extends BaseMapper<CereBuyerCollect> {

    int updateCollectIsRead();

    int deleteByPrimaryKey(Long collectId);

    int insertSelective(CereBuyerCollect record);

    CereBuyerCollect selectByPrimaryKey(Long collectId);

    int updateByPrimaryKeySelective(CereBuyerCollect record);

    int updateByPrimaryKey(CereBuyerCollect record);

    CereBuyerCollect findByUserProduct(@Param("buyerUserId") Long buyerUserId,@Param("productId") Long productId);

    CereBuyerCollect findByUserShopId(@Param("buyerUserId") Long buyerUserId,@Param("shopId") Long shopId);

    void cancel(@Param("ids") List<Long> ids,@Param("buyerUserId") Long buyerUserId,@Param("time") String time);

    void newCancel(@Param("productId") Long productId, @Param("shopId") Long shopId,
                   @Param("buyerUserId") Long buyerUserId, @Param("time") String time, @Param("salesType") Integer salesType);

    List<CollectProduct> getAllProduct(@Param("buyerUserId") Long buyerUserId,@Param("search") String search);

    List<CollectShop> getAllShop(@Param("buyerUserId") Long buyerUserId,@Param("search") String search);

    void updateSelected(@Param("ids") List<Long> ids);

    void deleteByIds(@Param("ids") List<Long> ids);

    void updateBuyerData(@Param("buyerUserId") Long buyerUserId,@Param("id") Long id);

    int findShopCollectCount(Long shopId);

    List<Long> getProductIds(Long buyerUserId);

    CereBuyerCollect findByUserDaynamicId(@Param("buyerUserId") Long buyerUserId,@Param("recommendId") Long recommendId);

    List<CereBuyerCollect> findByUserDaynamicS(Long buyerUserId);

    List<RecommendCollectVO> getCollectByRecommendIds(@Param("recommendIds") List<Long> recommendIds);

    List<RecommendPageVO> getCollectRecommendPage(@Param("buyerUserId") Long buyerUserId,@Param("recommendId") Long recommendId, @Param("blockedUserIds") List<Long> blockedUserIds);

    void deleteByRecommendId(Long recommendId);

    List<Long> selectCollectIds();

    Long findUserCollectCount(Long buyerUserId);

    boolean updateCollectIsReadByUserId(Long buyerUserId);

    List<LikeAndCollectInfo> selectCollectByUserId(Long buyerUserId);

    int updateIsReadByUserId(Long buyerUserId);

    Integer deleteUserInfo(@Param("recommendIds") List<Long> recommendIds, @Param("buyerUserId") Long buyerUserId);

    List<Long> selectCollectIdsByUserId(Long buyerUserId);
}
